# Quick Git (qg)

Quick git is a git(1) frontend written in POSIX shell and awk.

Goals:
- 100% POSIX compliance
- provide a quick-to-type interface to git(1)
- be as powerful as possible
- allow unknown commands to pass through to git(1)
- don't suck

Works:
- add (a)
- branch (b _s_), where _s_ is the branch name
- diff (d)
- checkout (C _s_), where _s_ is the branch name
- commit (c)
- grep (g, _s_), where _s_ is the query
- log (l)
- merge (M _s_), where _s_ is the branch name
- pull (p)
- push (P)
- restore (r) via row numbers
- rm (R)
- stash (S)
  - (where _x_ is the stash number)
  - stash branch (Sb _x_)
  - stash clear (Sc _x_)
  - stash drop (Sd _x_)
  - stash list (Sl _x_)
  - stash pop (Sp _x_)
  - stash save (Ss _x_)
  - stash show (Ss _x_)

Doesn't Work:
- anything I didn't mention above :)

## Quick Syntax Guide
qg attempts to keep it's commands as the first letter of the
git(1) command: commit is c, pull is p, status is s, diff is d, etc.
There are some many commands with the same starting letter: push and
pull, commit and checkout, etc. In that case, qg will attempt to keep
commands that effect the remote with a capital letter and local
commands with a lower case: P for push, C for checkout, etc. There
are some exceptions such as S for stash.

qg commands are always singular letters and their arguments are as
well -- unless the command excepts numbers such as the `a` (add)
command. qg commands are also always concatenated together without
any spaces such as `a1-2cP` (add files 1 through 2, commit, and push)
or `Sp` (stash pop). Note that any indicator that isn't qg's should
have a space such as `b ${branch}` (branch ${branch}) or `Sp 0`
(stash pop 0). The stash commands use their own ids and are _not_
related to the numbers listed by the `s` command and accepted by the
`a` command.

## Examples:
### Want to run `git status`
```
$ qg s
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
1.	modified:   qg

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
2.	modified:   README.md
3.	modified:   qg

Untracked files:
  (use "git add <file>..." to include in what will be committed)

```
Note the numbers on the left side of the output on the lines that contain
files.

### Want to add certain files, commit, and then push all in 1 command:
```
$ qg a1-3cP
```
Type the commit message and boom, it's pushed.

### Want to pop a stash:
```
$ qg Sp 0
```
Where _0_ is the stash id.

### Want to merge in master but you're not sure if you have the last changes:
```
$ qg CpCMP master my_branch master
```
The first `C` checks out master and `p` pulls. Then we `C` to checkout
my_branch, `M` to merge master, and then `P` to push it. When you use
the `C` and `M` commands, they shift the inputs and therefore you can
string branch commands together.

